Skip to content

feat: replace Bitnami Keycloak dependency with cloudpirates chart#46

Merged
aaronzi merged 3 commits intoeclipse-basyx:mainfrom
arnoweiss:chore/helm-deps
Apr 14, 2026
Merged

feat: replace Bitnami Keycloak dependency with cloudpirates chart#46
aaronzi merged 3 commits intoeclipse-basyx:mainfrom
arnoweiss:chore/helm-deps

Conversation

@arnoweiss
Copy link
Copy Markdown
Contributor

@arnoweiss arnoweiss commented Apr 14, 2026

Summary

  • Replace bitnami/keycloak@24.4.11 with cloudpirates/keycloak@0.20.0 to resolve Bitnami dependency issues
  • Slim BaSyx-realm.json and rbac config

Relates: #44

Reviewer Tasks

I've tested these on an internal cluster with slightly different values. deployed and integrated successfully.

  • helm install deploys without errors
  • Keycloak starts and imports BaSyx realm successfully
  • Client credentials flow works for basyx-technical-user and token carries admin realm role
  • AAS Environment returns 200 with a valid Bearer token

Relates: eclipse-basyx#44

- Replace bitnami/keycloak@24.4.11 with cloudpirates/keycloak@0.20.0
- Slim BaSyx-realm.json to minimal config: admin role, basyx-client-api
  client roles, basyx-technical-user service account with admin role
- Add all RBAC roles from values.yaml to the realm; remove all -two and
  -three suffixed roles from realm and rbac rules across all services
- Set proxyHeaders to xforwarded and ingress className to nginx in
  values.yaml
- Bump chart version to 2.2.0
@arnoweiss
Copy link
Copy Markdown
Contributor Author

@aaronzi

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the umbrella Helm chart’s Keycloak dependency away from Bitnami to the CloudPirates Keycloak chart (addressing the Bitnami artifact/dependency availability concerns in #44), and updates the chart’s default Keycloak configuration and realm/RBAC examples accordingly.

Changes:

  • Replace the bitnami/keycloak chart dependency with cloudpirates/keycloak (OCI) and bump the umbrella chart version.
  • Update values.yaml Keycloak settings to match the new chart structure (image, postgres subchart key, ingress structure, realm import settings).
  • Slim down BaSyx-realm.json and example RBAC blocks; adjust APIRule port and CI repo-add logic for OCI deps.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
charts/basyx/Chart.yaml Switch Keycloak dependency to CloudPirates OCI chart and bump chart version.
charts/basyx/values.yaml Update Keycloak values structure (image, postgres key, ingress, service port) and slim RBAC examples.
charts/basyx/templates/keycloak/basyx-keycloak-apirule.yaml Update APIRule to target the Keycloak service port used by the new setup.
charts/basyx/config/BaSyx-realm.json Replace large realm export with a minimal realm/client/role setup for BaSyx.
.github/workflows/tests.yml Prevent helm repo add from attempting to add OCI repositories during CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread charts/basyx/values.yaml Outdated
@@ -106,13 +145,17 @@ keycloak:
enabled: false
## @param keycloak.ingress.ingressClassName IngressClass for the ingress
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keycloak.ingress now uses the field className, but the docs still reference keycloak.ingress.ingressClassName. This makes the values file misleading and can break generated documentation. Update the @param annotation (and optionally the label text) to match the actual key (keycloak.ingress.className).

Suggested change
## @param keycloak.ingress.ingressClassName IngressClass for the ingress
## @param keycloak.ingress.className IngressClass for the ingress

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

Comment thread charts/basyx/values.yaml
Comment on lines 192 to 195
extraVolumes:
- name: basyx-keycloak-realm
configMap:
name: basyx-keycloak-realm
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keycloak.fullnameOverride controls the realm ConfigMap name ({{ .Values.keycloak.fullnameOverride }}-realm), but the default extraVolumes[].configMap.name is hard-coded to basyx-keycloak-realm. If a user overrides fullnameOverride, the pod will try to mount a non-existent ConfigMap. Consider making the ConfigMap name stable (not derived from fullnameOverride), or generate the default volume reference in templates so it always matches the rendered ConfigMap name.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

@arnoweiss arnoweiss Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made a constant

service:
name: {{ .Values.keycloak.fullnameOverride }}
port: 80
port: 8080
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The APIRule service port is hard-coded to 8080, even though values.yaml now defines keycloak.service.httpPort. Hard-coding risks drift if the Keycloak service port is changed via values. Use the configured value (or derive it from the Keycloak subchart service port) instead of a constant.

Suggested change
port: 8080
port: {{ .Values.keycloak.service.httpPort | default 8080 }}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Comment on lines +156 to +166
"clientId": "basyx-technical-user",
"name": "BaSyx Technical User",
"description": "Technical service account client for machine-to-machine access with admin role",
"enabled": true,
"clientAuthenticatorType": "client-secret",
"secret": "change-me-pls",
"standardFlowEnabled": false,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": false,
"serviceAccountsEnabled": true,
"publicClient": false,
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The realm import JSON hard-codes the basyx-technical-user client secret ("change-me-pls"). This makes the default deployment insecure (anyone with chart access can mint admin tokens) and forces users to edit a tracked file to rotate secrets. Please make this secret configurable via values and source it from a Kubernetes Secret (or generate it at install time) rather than committing a fixed credential into the realm file.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added secret parameterized via values.yaml.

service:
name: {{ .Values.keycloak.fullnameOverride }}
port: 80
port: 8080
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this port change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's taken care of above - it's configurable now. The defaults exposed by the image changed.

Comment thread charts/basyx/Chart.yaml
Comment on lines +69 to +71
- name: keycloak
version: "0.20.0"
repository: oci://registry-1.docker.io/cloudpirates
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the recommended image to use? Is it maintained and are current vulnerabilities considered?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chart just wraps the image. The image the chart defaults to is the official postgres image [1]. Cloudpirates has been the go-to distribution in the Tractus-X context [2] since bitnami refusing to deliver free updates to their self-hosted images. So we're arguably way better off.

[1] image: docker.io/keycloak/keycloak:26.5.6@sha256:8d44614c7479
[2] https://eclipse-tractusx.github.io/docs/release/trg-5/trg-5-07/

run: |
for dir in $(ls -d charts/*/); do
helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '$3 !~ /^file:/ { print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '$3 !~ /^file:/ && $3 !~ /^oci:/ { print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the impact of this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pipeline not crashing, see https://github.com/eclipse-basyx/charts/actions/runs/24389821173/job/71232645058. OCI-repos don't have to be helm add'ed

Comment thread charts/basyx/values.yaml
httpEnabled: true
## @param keycloak.keycloak.production false = start-dev mode, true = production start
##
production: false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended to be set to false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@aaronzi
Copy link
Copy Markdown
Member

aaronzi commented Apr 14, 2026

Thanks for the answers and the small fixes @arnoweiss. Looks good to me now. Is this PR ready to merge or do you still want to add/change something?

@arnoweiss
Copy link
Copy Markdown
Contributor Author

Done from my perspective.

@aaronzi aaronzi merged commit 57b9005 into eclipse-basyx:main Apr 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants